<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class ActivityResource extends JsonResource
{
	public function toArray($request)
	{
		$resource = $this->resource;
		
		return [
			'id'                => (int)$resource->id,
			'cover'             =>  $resource->cover ? img_path($resource->cover) : '',
			'name'              => $resource->name ?? '',
			'data'              =>$resource->data ?? '',
			'start_at'          => date("Y-m-d",strtotime($resource->start_at)),
			'end_at'            => date("Y-m-d",strtotime($resource->end_at)),
			
		];
	}
}
